let swiperwrapper = document.querySelector(".swiper-wrapper");

let host = "http://127.0.0.1:1337";

let url = host + "/api/v1/banners";
// id:2为商品分类
let obj = {category:2};
let p1 = axios.get(url,{params:obj});
p1.then(function(res) {
    let imgArr = res.data.data;
    let str = imgArr.map(item=> {
        return ` 
           <div class="swiper-slide"><img src="${host}${item.coverImage}" alt=""></div>
        `
    }).join("");
    swiperwrapper.innerHTML = str;
    console.log(imgArr);
})


